//
//  AnoleSDK.h
//  AnoleSDK
//
//  Created by mac on 2022/7/13.
//

#import <Foundation/Foundation.h>
#import "AnoleSDKConfig.h"
#import "AnoleAppInfo.h"
#import "AnoleAppRequest.h"
#import "AnoleAppManager.h"
#import "AnoleOpenAppLoadingView.h"

//! Project version number for AnoleSDK.
FOUNDATION_EXPORT double AnoleSDKVersionNumber;

//! Project version string for AnoleSDK.
FOUNDATION_EXPORT const unsigned char AnoleSDKVersionString[];


// In this header, you should import all the public headers of your framework using statements like #import <AnoleSDK/PublicHeader.h>

#import "AnoleH5ViewController.h"
#import "AnoleTabbarViewController.h"
#import "AnoleSearchViewController.h"
#import "AnoleSearhHomeViewController.h"

typedef void (^AnoleSDKErrorBlock)(NSError *error);
typedef void (^AnoleSDKErrorStringBlock)(NSError *error,NSString *info);
typedef void (^AnoleSDKErrorAppInfoBlock)(NSError *error,AnoleAppInfo *info);


@interface AnoleSDK : NSObject

+(AnoleSDK *)sharedSDK;

@property (nonatomic ,readonly) NSString *token;

@property (nonatomic ,readonly) NSString *userID;

//所有收藏的小程序列表
@property (nonatomic, readonly) NSArray <AnoleAppInfo *>*collectApps;

//当前打开的小程序
- (AnoleAppInfo *)currentApplet;


//初始化sdk，返回错误或者授权token
- (void)initWithConfig:(AnoleSDKConfig *)config compliton:(AnoleSDKErrorStringBlock)compliton;

//显示小程序主界面，包含搜索小程序，最近使用的小程序，收藏的小程序三项
- (void)pushAnoleHomePageInNavigationController:(UINavigationController *)navigationController;

//打开某一个小程序
- (void)presentAnoleAppWithAppRequest:(AnoleAppRequest *)appRequest viewController:(UIViewController *)viewController compliton:(AnoleSDKErrorAppInfoBlock)compliton;

//显示开发授权界面
-(void) showDevelopAuthViewWithToken:(NSString *)lgToken  userID:(NSString *)userID userName:(NSString *)userName inWindow:(UIWindow *)containerWindow compliton:(AnoleSDKErrorBlock)block;

//收藏app
- (void) collectApp:(AnoleAppInfo *)app compliton:(AnoleSDKErrorBlock)compliton;
//取消收藏
- (void) unCollectApp:(NSString *)appID compliton:(AnoleSDKErrorBlock)compliton;

@end
